package com.example.survey23.mapper;

import com.example.survey23.entity.SurveyBase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 23Group
 * @since 2022-11-01
 */
@Repository
@Mapper
public interface SurveyBaseMapper extends BaseMapper<SurveyBase> {

    @Select("select * from survey_base where state = #{state}")
    List<SurveyBase> getSurveyByStatus(int state);

    @Select("select max(id) from  survey_base")
    Long getMaxSurveyBaseId();


}
